package com.zxe.controller;

import com.zxe.service.UserService;
import com.zxe.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zxe.dto.UserDTO;

import java.util.List;

//@RefreshScope
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/{id}")
    public Result<UserDTO> getById(@PathVariable Integer id){
        return new Result<UserDTO>().ok(userService.getById(id));
    }

    @GetMapping("/getAll")
    public Result<List<UserDTO>> getAll(){

        return new Result<List<UserDTO>>().ok(null);
    }
}
